{extend name='table'}

{block name="content"}
<div class="layui-tab layui-tab-card">
    <ul class="layui-tab-title">
        {foreach ['1'=>lang('崔市昌'),'2'=>lang('陈悦'),'3'=>lang('王浩')] as $k=>$v}
        {if isset($code) and $code eq $k}
        <li data-open="{:url('index')}?code={$k}" class="layui-this">{$v}</li>
        {else}
        <li data-open="{:url('index')}?code={$k}">{$v}</li>
        {/if}
        {/foreach}
    </ul>
    <div class="layui-tab-content">
        <table id="DataAddTable" data-url="{:sysuri('index')}" data-target-search="form.form-search"></table>
    </div>
</div>

<script>
    $(function () {
        $('#DataAddTable').layTable({
            even: true, height: 'full',
            where: {code: '{$code|default="1"}'},
            cols: [[
                {field: 'datestr', title: '{:lang("日期")}', minWidth: 100, align: 'center', templet: '<div>{{d.datestr||"-"}}</div>'},
                {field: 'members_num', title: '{:lang("新增会员数")}', minWidth: 100, align: 'center', templet: '<div>{{d.members_num||"0"}}</div>'},
                {field: 'active_contact_num', title: '{:lang("主动联系数")}', minWidth: 100, align: 'center', templet: '<div>{{d.active_contact_num||"0"}}</div>'},
                {field: 'new_members_order_num', title: '{:lang("新增会员首次下单数")}',minWidth: 100, align: 'center',  templet: '<div>{{d.new_members_order_num||"0"}}</div>'},
                {field: 'order_price', title: '{:lang("日销售额")}', align: 'center', minWidth: 80},
            ]]
        });
    });
</script>
{/block}